<template>
	<view class="box">
		<uNavbar title="换绑手机" bgColor="transparent"></uNavbar>
		<view class="title">
			<!-- 请输入您的实名信息 -->
		</view>
		<view class="main_item">
			<view class="main_item_title">
				原手机号
			</view>
			<input type="number" :value="oldphone" placeholder="请输入新手机号" @input="getoldphone" />
		</view>

		<view class="main_item">
			<view class="main_item_title">
				新手机号
			</view>
			<input type="number" :value="phone" placeholder="请输入新手机号" @input="getphone" />
		</view>
		<view class="main_item">
			<view class="main_item_title">
				xxxx支付密码
			</view>
			<input type="safe-password" :value="pass" placeholder="请输入新的xxx支付密码"  @input="getpass" />
		</view>
		<view class="main_item">
			<view class="main_item_title">
				验证码
			</view>

		</view>
		<view class="binding flex_dq" style="margin-top: 30px;">
			<u-input placeholder="请输入验证码" maxlength="6" v-model.trim="validateCode">
				<template slot="suffix">
					<u-code ref="uCode" @change="codeChange" seconds="60" changeText="X秒重新获取"></u-code>
					<u-button @tap="getCode" :text="tips" type="success" size="mini"></u-button>
				</template>
			</u-input>
		</view>
		<view class="btn">
			确定
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				oldphone:"",
				name: "",
				pass:null,
				phone: "",
				validateCode: "",
				tips: '',
			}
		},
		methods: {
			getname(e) {
				this.name = e.detail.value
			},
			getphone(e) {
				this.phone = e.detail.value
			},
			getpass(e) {
				this.pass = e.detail.value
			},
			getoldphon(e) {
				this.oldphon = e.detail.value
			},
			codeChange(text) {
				this.tips = text;
			},
			getCode() {
				console.log(11111);
				// let that = this;
				// uni.showLoading({
				// 	title: '正在获取验证码'
				// });
				// login(data).then(res => {
				// 	console.log(res);
				// 	uni.hideLoading();
				// 	if (res.code == 0) {
				// 		if (that.$refs.uCode.canGetCode) {
				// 			that.$refs.uCode.start();
				// 		}
				// 	} else {
				// 		uni.$u.toast(res.msg);
				// 	}
				// })
			},
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 750rpx;
		height: 100vh;
		background-color: #211E38;
	}

	.title {
		width: 700rpx;
		margin-top: 40rpx;
		font-weight: 400;
		font-size: 32rpx;
		color: #FFFFFF;
		margin-left: 50rpx;
	}

	.main_item {
		width: 750rpx;

		.main_item_title {
			font-weight: 400;
			font-size: 30rpx;
			color: #FFFFFF;
			margin-left: 50rpx;
			margin-top: 70rpx;
		}

		>input {
			margin: 0 auto;
			margin-top: 40rpx;
			width: 670rpx;
			height: 96rpx;
			line-height: 96rpx;
			font-weight: 300;
			font-size: 30rpx;
			color: #A6A5AF;
			background: #342857;
			padding-left: 20rpx;
			border-radius: 12rpx 12rpx 12rpx 12rpx;
		}
	}

	.binding {
		width: 90%;
		margin: 0 auto;
		padding: 18rpx 0;
		border-radius: 60rpx;
		// background: #2B2749;
		/* border-bottom: 1rpx solid #5a5a5a70; */
	}

	/deep/.u-button--success {
		background: none !important;
		border: none !important;
		color: #FF2CDF !important;
	}

	/deep/.u-border {
		width: 670rpx;
		height: 96rpx;
		background: #342857;
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		border: none;
		
	}

	/deep/.uni-input-wrapper {
		color: #A6A5AF !important;
	}

	/deep/.uni-input-placeholder {
		color: #A6A5AF !important;
	}

	.btn {
		width: 690rpx;
		height: 88rpx;
		background: linear-gradient(274deg, #0014FF 0%, #8020EF 50%, #FF2CDF 100%);
		border-radius: 332rpx 332rpx 332rpx 332rpx;
		margin: 0 auto;
		margin-top: 50rpx;
		font-weight: 400;
		font-size: 36rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 88rpx;
	}
</style>